aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/invoice/[amount].js
blob: 9e9678a65caa8b001f38718227aefbdcc7e4ab14 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
import { post } from '$lib/utils';

const username = 'bob',
	network = 'lightning';

export async function GET({ params }) {
	let { amount } = params;
	let { text } = await post('/lightning/invoice', { amount });
	await post('/invoice', { invoice: { text, network }, user: { username } });

	return { body: { amount, text } };
}